<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //构造函数
        function Person(name, age) {
            this.name = name
            this.age = age

            //借用构造函数

            OldFather.call(this, 'pagani', 1000000000)
        }

        function OldFather(car, money) {
            // this.name = name
            this.car = car
            this.money = money
            this.houses = {
                beijing: '四合院',
                shanghai: '汤臣一品',
                shenzhen: '深圳湾'
            }
        }
        var wxb = new OldFather('pagani', 1000000000)
        // Person.prototype = wxb

        var lilei = new Person("lilei", 18)
        var hmm = new Person(" hmm", 16)

        lilei.houses.beijing = '出租房'
        console.log(lilei)
        console.log(hmm)
        console.log(wxb)
    </script>
</body>

</html>